﻿using System;
using Agro.Models;
using SN.Data;
using System.Collections.Generic;

namespace Agro.Services
{
    public class SbrqService : BaseService, ISbrqService
    {
        public string SbrqSave(string Comment, string sValue, string sFormatDay)
        {
            string Msg = string.Empty;
            try
            {
                T_DeadlineConfig config = DB.From<T_DeadlineConfig>().Where(T_DeadlineConfig._.Comment == Comment).ToSingle();

                config.Value = Convert.ToInt32(sValue);
                config.FormatDay = Convert.ToInt32(sFormatDay);
                config.Attach();
                DB.Save<T_DeadlineConfig>(config);
            }
            catch (Exception ex)
            {
                Msg = ex.Message;
                throw;
            }
            return Msg;
        }
    }
}
